package util;

import java.util.Random;

/**
 * @author rpitts@gmu.edu
 */
public class RandomLogNormal {

	private double standardDeviation = 1;
	private double logOfMean = 0;
	
	private Random random = new Random ();

	public RandomLogNormal(double standardDeviation, double mean) {
		super();
		this.standardDeviation = standardDeviation;
		this.logOfMean = Math.log(mean);
	}
	
	public double retrieve() {
		double nextG = random.nextGaussian();
		
		//System.out.println("Details: " + nextG + " " + this.standardDeviation + " " + this.logOfMean);
		return Math.exp(nextG*this.standardDeviation + this.logOfMean);
	}
	
}
